<template>
	<view class="layout">
		<view class="box1" hover-class="backgroundHover" hover-start-time="1000">
			{{count}}
		</view>
		<view class="box2" hover-class="backgroundHover" hover-stay-time="3000">
			{{count * count}}
		</view>

		<button @click="countAdd()">Count + 1</button>
		<button @click="countRe()">Count - 1</button>
		
		<wd-button>主要按钮</wd-button>
		<wd-button type="success">成功按钮</wd-button>
		<wd-button type="info">信息按钮</wd-button>
		<wd-button type="warning">警告按钮</wd-button>
		<wd-button type="error">危险按钮</wd-button>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	const count = ref(0);

	const countAdd = () => {
		count.value = count.value + 1;
	}

	const countRe = () => {
		count.value = count.value - 1;
	}
</script>

<style scoped lang="scss">
	.layout {
		margin-top: 10px;
		display: flex;

		flex-direction: column;
		justify-content: center;
		align-items: center;

		text-align: center;

		gap: 10px;

		.box1 {
			width: 100px;
			height: 100px;

			background-color: aquamarine;
		}

		.box2 {
			width: 100px;
			height: 100px;

			background-color: bisque;
		}
	}

	.backgroundHover {
		background-color: chocolate !important;
	}
</style>